#Default Makefile for Illusion applications

CC := i686-elf-gcc
CFLAGS := -O0 -I.. -c -m32 -ffreestanding -nostdinc -Wall -std=c99 -fleading-underscore -g -Werror -Wno-unused
LD := i686-elf-ld
LDFLAGS := -T./link.ld -nostdlib -nodefaultlibs
AS := nasm
ASFLAGS := -felf32


all: load.o $(OBJECTS)
	$(LD) $(LDFLAGS) -o $(OUTPUT) load.o $(OBJECTS)

clean:
	rm -rf $(OBJECTS) load.o $(OUTPUT)

%.o: %.c
	$(CC) $(CFLAGS) $< -o $@

%.o: %.s
	$(AS) $(ASFLAGS) $< -o $@